<template>
    <div>
        test <br>
        {{testFromZong}}
        {{test1}}
    </div>

</template>

<script>
    import {getBaseCategoryList,getBanners,getFloors} from 'http/apiServer'
    import {mapState} from 'vuex'
    export default {
        name: "test",

        methods: {

        },

        computed: {
            /*
                mapState([总仓库中的数据名称])
                mapState({组件上使用的名称:总仓库中的数据名称})
                mapState({组件上使用的名称:(state) => { // state:总仓库的state}})
            */
            // ...mapState(['test']),
            ...mapState({
               testFromZong:(state) => {
                   // 查看vuex中的数据结构进行编写
                   return state.state.test2
               }
            }),

            ...mapState({
               test1: state => state.a.test1,
            })
        },

        async created() {
            const body = await getBaseCategoryList();
            const body2 = await getBanners();
            const body3 = await getFloors();

            console.log(body);
            console.log(body2);
            console.log(body3);
        }
    }
</script>

<style scoped>

</style>